#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// 字符串就是首字符的地址
void func(char *s1,char *s2)
{
    *s1 = 'H';
    *s2 = 'L';
}

int main(int argc, char *argv[])
{
    char *ptr = "hello world";   //指针指向字符串   //保存在数据的or段;该数据不能被修改;
    //int num = 5;
    //ptr++;
    //(*ptr) = 'E';


    char src[100] = "hello world";   //定义一个数组，数组里保存一个字符串  //栈开辟100个字节


    char *str = (char *)malloc(sizeof(char) * 100); //开辟一个空间
    //strcpy(str, "hello world");  //将字符串拷贝进str

    //func ("hello1","hello2");    //hello1 , hello2 也在or段里面
    func(src, str);

    strcpy(str, "hello world");


    printf("hello world = %p\n", "hello world");
    printf("ptr = %p\n", ptr);
    printf("src = %p\n", src);
    printf("str = %p\n", str);
    return 0;
}


